<template>
	<view class="content">
		<view class="title">
			<uni-icons type="back" size="30" class="icons"></uni-icons>
			<button class="btn" plain="true">注册</button>
		</view>


		<!-- 标识 -->
		<view class="text-im">
			<text>MakeUp</text>
		</view>

		<!-- 输入框 -->
		<view class="uni-form-item">
			<input v-model="user" type="text" class="uni-input" focus placeholder="请输入账号"
				placeholder-style="font-size:12px;" />
			<input v-model="pwd" type="password" class="uni-input" focus placeholder="请输入密码"
				placeholder-style="font-size:12px;" />
		</view>

		<!-- 登录按钮 -->
		<button class="btn_login" @click="doLogin">登录</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user: "",
				pwd: ""
			}
		},
		methods: {
			doLogin() {
				if (this.pwd.length < 6) {
					uni.showToast({
						title: "密码不正确!",
						icon: 'none',
						duration: 2000,
						position: 'bottom'
					})
					return;

				} else if (this.user.length < 6) {
					uni.showToast({
						title: "账号不正确!",
						icon: 'none',
						duration: 2000,
						position: 'bottom'
					})
					return;
				}
				uni.switchTab({
					url: "/pages/index/index"
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	// 一楼头部
	.title {
		display: flex;
		width: 600rpx;
		align-items: center;
		margin: 0 auto;

		button {
			margin-right: 0;
			color: $uni-text-color-grey;
			border: 0;
			font-size: $uni-font-size-base;
		}
	}

	// 二楼标题
	.text-im {
		margin: 0 auto;
		margin-top: 30rpx;
		font-size: $uni-font-size-lg;
		font-weight: bold;
	}

	// 三楼输入框
	.uni-form-item {
		display: block;
		width: 600rpx;
		height: 270rpx;
		margin: 0 auto;


		input {
			background-color: $uni-bg-color-grey;
			border-radius: 60rpx;
			margin-top: 20rpx;
			height: 100rpx;
			padding-left: 40rpx;
			padding-right: 40rpx;
		}
	}

	// 四楼登录按钮
	.btn_login {
		border-radius: 50rpx;
		width: 500rpx;
		text-align: center;
		background: url('../../static/image/Button_blackImage.png') center;
		color: $uni-bg-color;
	}
</style>
